package com.zlf.the.strategy;

import com.zlf.the.strategy.entity.Context;
import com.zlf.the.strategy.impl.OperationAdd;
import com.zlf.the.strategy.impl.OperationMultiply;
import com.zlf.the.strategy.impl.OperationSubstract;

public class StrategyPatternDemo {
		public static void main(String[] args) {
				Context context = new Context(new OperationAdd());
				System.out.println("10 + 5 = " + context.executeStrategy(10, 5));

				context = new Context(new OperationSubstract());
				System.out.println("10 - 5 = " + context.executeStrategy(10, 5));

				context = new Context(new OperationMultiply());
				System.out.println("10 * 5 = " + context.executeStrategy(10, 5));
		}
}
